cmake_minimum_required(VERSION 3.0.2)
project(global_planner)

add_compile_options(-std=c++11)

find_package(PCL REQUIRED)
find_package(Eigen3 REQUIRED)
find_package(OMPL REQUIRED)

find_package(catkin REQUIRED COMPONENTS
  pcl_ros
  quad_msgs
  roscpp
  trajectory_optimization
  transform_utils
  sensor_msgs
  nav_msgs
  visualization_msgs
  rosbag
)

catkin_package()

include_directories(
  include
  ${catkin_INCLUDE_DIRS}
  ${PCL_INCLUDE_DIRS}
  ${EIGEN3_INCLUDE_DIRS}
  ${OMPL_INCLUDE_DIRS}
)

add_library(ompl_planner src/ompl_planner.cpp)
target_link_libraries(ompl_planner
  ${catkin_LIBRARIES}
  ${OMPL_LIBRARIES}
  ${PCL_LIBRARIES}
)

add_library(global_planner src/global_planner.cpp)
target_link_libraries(global_planner
  ${catkin_LIBRARIES}
  ${PCL_LIBRARIES}
  ompl_planner
)

add_executable(global_planner_node src/global_planner_node.cpp)
target_link_libraries(global_planner_node
  ${catkin_LIBRARIES}
  global_planner
)

add_executable(traj_process_node src/traj_process_node.cpp)
target_link_libraries(traj_process_node
  ${catkin_LIBRARIES}
)

add_executable(generate_traj test/generate_traj.cpp)
target_link_libraries(generate_traj
  ${catkin_LIBRARIES}
)